package com.lifuixng.picturebackend.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lifuixng.picturebackend.common.DeleteRequest;
import com.lifuixng.picturebackend.model.dto.user.*;
import com.lifuixng.picturebackend.model.entity.Picture;
import com.lifuixng.picturebackend.model.entity.User;
import com.baomidou.mybatisplus.extension.service.IService;
import com.lifuixng.picturebackend.model.vo.user.UserLoginVO;
import com.lifuixng.picturebackend.model.vo.user.UserVO;

import javax.servlet.http.HttpServletRequest;

/**
* @author 26966
* @description 针对表【user(用户)】的数据库操作Service
* @createDate 2024-12-14 14:09:16
*/
public interface UserService extends IService<User> {

    /**
     * 注册
     * @param userRegisterRequest
     * @return
     */
    Long userRegister(UserRegisterRequest userRegisterRequest);

    /**
     * 加密
     * @param userPassWord
     * @return
     */
    String getEncryptPassword(String userPassWord);

    /**
     * 用户登录
     * @param userLoginRequest
     * @param request
     * @return
     */
    UserLoginVO userLogin(UserLoginRequest userLoginRequest, HttpServletRequest request);

    /**
     * 获取当当前登录的信息
     * @param request
     * @return
     */
    User userLoginInfo(HttpServletRequest request);

    /**
     * 获取当当前登录的信息
     * @param request
     * @return
     */
    UserLoginVO getLoginUser(HttpServletRequest request);

    /**
     * 退出登录
     * @param request
     * @return
     */
    boolean userLogout(HttpServletRequest request);

    QueryWrapper<User> getQueryWrapper(UserQueryRequest userQueryRequest);

    int addUser(UserAddRequest userAddRequest);

    int deleteById(DeleteRequest deleteRequest);

    int updateUser(UserUpdateRequest userUpdateRequest);

    User getUserById(Long id);

    UserVO getUserVOById(Long id);

    Page<UserVO> userListByPage(UserQueryRequest userQueryRequest);

    boolean isAdmin(User user);
}
